home *** CD-ROM | disk | FTP | other *** search
-
- function units_lbot_alien_setup()
- units_setup(4,true,ENET_EFFECT_PS_SETUPSMOKE_SMALL,ENET_EFFECT_GEOMETRY_SMALLROBOTALIENSHADOW)
- end
-
- function units_lbot_alien_resetup()
- units_setup(4,true,nil,ENET_EFFECT_GEOMETRY_SMALLROBOTALIENSHADOW)
- end
-
- function units_lbot_alien_select()
- units_select(12,1)
- end
-
- function units_lbot_alien_unselect()
- units_unselect()
- end
-
- function units_lbot_alien_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_lbot_alien_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_lbot_alien_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_lbot_alien_explode()
- units_explode_small1_green()
- end
-
- function units_lbot_alien_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound("smallrobot_move.wav",1)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 1.8))
- local steps = {}
- local stepsmoke = {}
- local i = 0;
- for i = 0,1 do
- steps[i] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_DYNAMICGEOMETRY_WHEELSTEPSEMITTER)
- stepsmoke[i] = unit:getBone(ENBT_STEPEMITTER,i):addSimpleEffect(ENET_EFFECT_PS_NEWTRACKSMOKE5)
-
- end
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,100))
- for i = 0,1 do
- if(unit:getScale() < 1.0) then
- steps[i]:destroy()
- else
- steps[i]:setTransformOwner()
- steps[i]:suspendedDestroy(70)
- end
- stepsmoke[i]:suspendedDestroy(5)
- end
- sound:destroy()
- end
-
- function units_lbot_alien_fire()
- local unit = uniGetExecutor()
- if (unit:getTransformOwner() ~= nil) then
- local carrier = unit:getTransformOwner():getTransformOwner()
- while(carrier:getCurrentCommandUID() < 2000000000) do pause() end
- waitDeath(carrier:addRotationEffect(ENET_EFFECT_ROTATE_UNITTOTARGET,MATH_PI,uniGetTarget()))
- else
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNITTOTARGET,MATH_PI,uniGetTarget()))
- end
- uniSetLife(uniGetLife() / 3.0)
- local gn = unit:getBone(ENBT_GUNNEST)
- local firespot = gn:getBone(ENBT_FIRE1)
- waitDeath(gn:aimGun(0,MATH_PI / 3.0,uniGetTarget()))
- local i = 0
- for i = 0,2 do
- gn:play3DSound("smallrobot_fire.wav",0):destroy()
- local shot1 = firespot:addBulletEffect(ENET_EFFECT_BULLET_GREENLASERBOLT)
- shot1:executeCommand(ENC_FIRE1)
- gn:gunRecoil(0,0.1,4)
- pause(0.1)
- end
- unit:addFireArrow()
- end
-
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_MOVE,"units_lbot_alien_move")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_FIRE1,"units_lbot_alien_fire")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_FIRE2,"units_lbot_alien_fire")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_SELECT,"units_lbot_alien_select")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_SELECTENEMY,"units_lbot_alien_selectenemy")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_UNSELECT,"units_lbot_alien_unselect")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_SETUP,"units_lbot_alien_setup")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_RESETUP,"units_lbot_alien_resetup")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_DAMAGED,"units_lbot_alien_damaged")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_EXPLODE,"units_lbot_alien_explode")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_HIGHLIGHT,"units_lbot_alien_highlight")
- registerCommand(ENSCRIPTSET_SMALLROBOT_ALIEN,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_SMALLROBOT_ALIEN)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "smallrobot_alien.rmd"
- desc.ScriptSet = ENSCRIPTSET_SMALLROBOT_ALIEN
- desc.MoveType = ENMOVE_GROUNDORIENTED
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_SMALLROBOTALIENSHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "smallrobot_alien_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(13)
- unitDesc.group = 0
- unitDesc.order = 0
- unitDesc.unit_res_id = ENET_UNIT_SMALLROBOT_ALIEN
- unitDesc.unit_icon_id = "Smallrobot_a_small_normal.dds"
- unitDesc.active_id = "Smallrobot_a_small_active.dds"
- unitDesc.pressed_id = "Smallrobot_a_small_pressed.dds"
- unitDesc.big_icon_id = "Smallrobot_a_big_normal.dds"
- unitDesc.small_icon_id = "Smallrodot_l_stats.dds"
- unitDesc.HP = 4
- unitDesc.MP = 10
- unitDesc.WR = 1
- unitDesc.min_WR = 1
- unitDesc.WD = 1
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 0
- unitDesc.transport = 0
- unitDesc.value = 1
- unitDesc.race = 1
- unitDesc.fire_pause = 0.2
- unitDesc.move_pause = 0.5
- unitDesc.unit_info_scale = 0.08
- unitDesc.scn_name = "LBOTA"
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
-
- function bullets_greenlaserbolt_fire()
- local bullet = uniGetExecutor()
- bullet:setTransformOwner()
- local light = bullet:addSimpleEffect(ENET_EFFECT_LIGHT_GREENLASERBOLTFLY)
- local track = bullet:addSimpleEffect(ENET_EFFECT_PS_GREENLASERBOLT)
- waitDeath(bullet:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,400,uniGetTarget()),1000)
- light:destroy()
- track:destroy()
- local hit_ps = bullet:addSimpleEffect(ENET_EFFECT_PS_GREENLASERBOLTHIT)
- pause(0.2)
- hit_ps:suspendedDestroy(1.0)
- uniGetTarget():executeCommand(ENC_DAMAGED)
- pause(1.0)
- bullet:destroy()
- end
-
- registerCommand(ENSCRIPTSET_BULLET_GREENLASERBOLT,ENC_FIRE1,"bullets_greenlaserbolt_fire")
-